<template>
  <div class="setBar" @tap="setBarclick">
    <div v-if="icon" class="iconfont" :class="icon"></div>
    <div class="title">{{title}}</div>
    <div>
      <slot></slot>
    </div>
    <div class="back">
      <div class="iconfont icon-right"></div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    icon: {
      type: String,
      default: ''
    },
    title: {
      type: String,
      default: ''
    }
  },
  methods: {
    setBarclick () {
      this.$emit('setBarclick', this.title)
    }
  }
}
</script>

<style lang="scss" scoped>
  .setBar {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    background-color: white;
    border-bottom: 1px solid rgb(232, 232, 232);
    padding: 0 15px;
    font-size: 16px;
    box-sizing: border-box;
    > .iconfont {
      width: 25px;
      color: rgb(72, 72, 72);
    }
    > .title {
      flex: 1;
    }
    > .back {
      width: 30px;
      text-align: right;
      color: rgb(183, 183, 183);
      > .iconfont {
        font-size: 16px;
      }
    }
  }
</style>
